package com.brillilab.service.module.message.template.impl.announcement;

import com.brillilab.service.module.message.template.AbstractMessageTemplate;
import com.brillilab.service.module.message.template.enums.MessageTypeEnum;
import lombok.Data;

import java.util.Map;

/**
 * @author zlb
 * @Title: PublicAnnouncementTemp
 * @ProjectName brill_lab
 * @Description: 实验室内有公告发布
 * @date 2019/5/28 10:20
 */
@Data
public class PublicAnnouncementTemp extends AbstractMessageTemplate {
    private String operator;
    private String labName;

    /**
     * 实验室内有公告发布
     *
     * @param labId       实验室ID
     * @param receiverMap  接收人ID
     * @param operator    操作人
     * @param labName     实验室名称
     * @param referId     业务关联ID
     */
    public PublicAnnouncementTemp(Long labId,Map<Long,Long> receiverMap,String operator,String labName,Long referId) {
        super(labId, 0L);
        super.setType(MessageTypeEnum.PublicAnnouncement.getValue());
        super.setTitle("实验室内有新公告发布");
        String content = String.format("<span style='color:#F6AC2D'>%s</span><span>在</span>" +
                "<span style='color:#F6AC2D'>%s</span><span>发布了一条新公告</span>", operator, labName);
        super.setContent(content);
        super.setAppContent(String.format("%s在%s发布了一条新公告", operator, labName));
        this.operator = operator;
        this.labName = labName;
        this.referId = referId;
        super.setReceiverMap(receiverMap);
    }

}
